package tech.aistar.service;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import tech.aistar.entity.Collect;
import tech.aistar.entity.User;
import tech.aistar.service.impl.UserServiceImpl;

import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = {"classpath:spring/spring-anno.xml"})
@ContextConfiguration(locations = {"classpath:spring/spring-*.xml"})
public class testUserservice {

    @Autowired
    private UserServiceImpl userServiceImpl;
    @Test
    public void testfindAll(){
        System.out.println(userServiceImpl);
        User user = userServiceImpl.findUserBynickname("Tinamua12");
//        System.out.println(userList.size());
        System.out.println(user);
    }
    @Test
    public void testscore(){
        userServiceImpl.getUserExa("21");
    }

    @Test
    public void testfindUserById(){
        System.out.println(userServiceImpl);
        User user=userServiceImpl.findUserById(21L);
        System.out.println(user);
    }

    @Test
    public void testupdateUser(){
        System.out.println(userServiceImpl);
//       User user=userServiceImpl.updateUser();
//        System.out.println(user);
    }

    @Test
    public void testfindUserByColId() {
        System.out.println(userServiceImpl);

        List<Collect> users=userServiceImpl.fingByColId(21L);
        System.out.println(users);

    }






}
